home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1985 Summer / rerun-1985-summer-side-b.d64 / bargain hunter (.txt) next >
Commodore BASIC  |  2022-09-20  |  4KB  |  127 lines

  1. 1 rem 64 version/wallace
  2. 100 print"[147]":goto230
  3. 105 poke198,0:print"[145]";j$;" not on file":gosub130:return
  4. 110 ife$="none"thenreturn
  5. 115 e$=right$(e$,5)+" "+left$(e$,2)+" ":return
  6. 120 print"searching[146]":return
  7. 125 print"press c to continue"
  8. 130 print"press m for menu"
  9. 135 getf$:iff$=""then135
  10. 140 return
  11. 145 print"[147]enter month expires (2 digits)":forl=1to6:e$(l)="":next
  12. 150 ifz1=0thenprint"enter n if no expiration"
  13. 155 forl=1to6
  14. 160 gete$(l):ife$(l)=""ore$(l)<"0"ore$(l)>"9"ande$(l)<>"n"then160
  15. 165 ifz1=1ande$(l)="n"then160
  16. 170 ife$(l)="n"andz1=0then205
  17. 175 print""e$(l)"[145]"
  18. 180 ifl=2thenprint""e$(1);e$(2):print"enter day (2 digits)
  19. 185 [139]l[178]4[167][153]""e$(3);e$(4):[153]"enter year (2 digits)
  20. 190 next:print""e$(5);e$(6)
  21. 195 e$=e$(5)+e$(6)+" "+e$(1)+e$(2)+" "+e$(3)+e$(4)
  22. 200 e1$=e$(1)+e$(2)+" "+e$(3)+e$(4)+" "+e$(5)+e$(6):goto210
  23. 205 e$="none":e1$=e$
  24. 210 print""e1$:print"ok (y/n)"
  25. 215 gosub135:iff$="n"then145
  26. 220 iff$="y"thenreturn
  27. 225 goto215
  28. 230 bc=53280:sc=53281:pokebc,6:pokesc,1:b%=0:c%=0:d1$=" cents "
  29. 235 print"[147][151]coupon organizer[146]":print"1[146]  review entire file"
  30. 240 print" 2[146]  search by brand name":print" 3[146]  search by product"
  31. 245 print" 4[146]  compute total value":print" 5[146]  dump to printer"
  32. 250 print" 6[146]  update coupon file":print" 7[146]  save updated file"
  33. 255 print" 8[146]  quit":print"select function[146]"
  34. 260 gosub135:restore:iff$<"1"orf$>"8"then260
  35. 265 a=val(f$):onagoto275,290,295,555,335,610,590,270:goto265
  36. 270 sc=53281:pokesc,6:pokebc,14:print"[147][154]":clr:end
  37. 275 pokebc,7:gosub540:ifa$="end"then230
  38. 280 print"[147]":gosub445:iff$="m"then230
  39. 285 goto275
  40. 290 pokebc,8:input"[147]   enter brand";j$:gosub120:b%=1:goto300
  41. 295 pokebc,9:input"[147]   enter product";j$:gosub120:c%=1
  42. 300 gosub540:ifa$="end"then325
  43. 305 ifb%thenifb$<>j$then300
  44. 310 ifc%thenifc$<>j$then300
  45. 315 gosub445:gosub120:z=1:iff$="m"then230
  46. 320 goto300
  47. 325 ifzthen230
  48. 330 gosub105:goto230
  49. 335 pokebc,15:print"[147]printer ready? (y/n)"
  50. 340 gosub135:iff$<>"y"andf$<>"n"then340
  51. 345 iff$="n"then230
  52. 350 open1,4,1
  53. 355 reada$:ifa$="end"thenclose1:goto230
  54. 360 ifa$="#"thenreada:goto355
  55. 365 readb$,c$,d$,e$:gosub110
  56. 370 print#1,a$" "c$"    "b$"  "d$d1$"  "e$:ifpthenclose1:goto425
  57. 375 goto355
  58. 380 z=0:restore:z1=1:gosub145:z1=0:j$=e$
  59. 385 print"[147]":gosub120:d1$=" cents "
  60. 390 gosub540:ifa$="end"then430
  61. 395 ifval(e$)>val(j$)orval(e$)<1then390
  62. 400 p=1:gosub445:gosub120:z=1:iff$="m"then230
  63. 405 iff$="p"thenr$=a$:print"[145]hard copy? (y/n)":goto415
  64. 410 goto390
  65. 415 gosub135:iff$="y"thenopen1,4,1:goto370
  66. 420 iff$<>"n"then415
  67. 425 goto690
  68. 430 ifzthen440
  69. 435 e$=j$:gosub115:print"[145]   none expired as of ";e$;"":gosub130
  70. 440 p=0:goto230
  71. 445 forl=1to3:d(l)=int(rnd(0)*14)+2:next:b=32:e=646
  72. 450 h$="                                    [146]":print"[147]   file number:";a$
  73. 455 pokee,d(1):print"";h$:print;h$:print;h$
  74. 460 forl=1to7:print"          ":pokee,d(2):print,"[145][157]                      "
  75. 465 pokee,d(1):print,,,"[145]      ":next:print;h$:print;h$
  76. 470 print" [175] [175] [175] [175][160][175] [175] [175] [175] [175][160][175] [175][160][175] [175][160][175] [175] [175] [146]"
  77. 475 forl=1to5:print"[170]"spc(31)"[180]":print:next
  78. 480 print" [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [183] [146]":gosub110
  79. 485 ifval(d$)>99thenb=29:ifval(d$)>999thenb=28
  80. 490 ifval(d$)>99thend$="$"+left$(d$,len(d$)-2)+"."+right$(d$,2)
  81. 495 ifd$="free"thenb=30
  82. 500 pokee,d(3):print""tab(5)d$tab(b)d$:pokee,d(2):print,""b$
  83. 505 print,""c$:print,"exp. date: "e$:pokee,d(3):print""tab(5)d$tab(b)d$
  84. 510 print"[146][151]":poke198,0
  85. 515 ifpthenprint"press p to purge coupon[146]"
  86. 520 gosub125:iff$<>"m"andf$<>"c"andf$<>"p"thenprint"[145][145][145][145][145]":goto530
  87. 525 return
  88. 530 ifpthenprint"[145]"
  89. 535 goto520
  90. 540 reada$:ifa$="end"thenreturn
  91. 545 ifa$="#"thenreada:goto540
  92. 550 readb$,c$,d$,e$:return
  93. 555 d$="":t=0
  94. 560 pokebc,5:gosub540:ifa$="end"then570
  95. 565 t=t+val(d$):print"[147]";t:pokebc,13:goto560
  96. 570 t$=str$(t):z$=right$(t$,2):x$=left$(t$,len(t$)-2):t$=x$+"."+z$
  97. 575 print"[147]total value: $";t$;""
  98. 580 gosub130:iff$<>"m"thenprint"[145][145][145]":goto580
  99. 585 goto230
  100. 590 pokebc,4:print"[147]t[146]ape or d[146]isk?[145]":gosub135:iff$<>"t"andf$<>"d"then590
  101. 595 iff$="t"thensave"coupon organizer":goto230
  102. 600 print"saving update[146]":open15,8,15:print#15,"s0:coupon organizer"
  103. 605 close15:save"coupon organizer",8:goto230
  104. 610 bc=53280:pokebc,2:print"[147] 1[146]  add new coupons"
  105. 615 print" 2[146]  purge redeemed coupons"
  106. 620 print" 3[146]  purge expired coupons":print" 4[146]  return to menu"
  107. 625 p$(1)="brand name":p$(2)="product":p$(3)="coupon value (in cents)"
  108. 630 d1$=" cents "
  109. 635 gosub135:a=val(f$):onagoto645,685,380,230:goto610
  110. 640 poke198,2:poke631,13:poke632,13:end
  111. 645 print" standby[146]"
  112. 650 a=val(a$)+1:reada$:ifa$="#"thenreada:goto660
  113. 655 ifa$<>"end"thenreadb$,c$,d$,e$:goto650
  114. 660 print"[147]item : "a"":fori=1to3:print""p$(i):input"";w$(i)
  115. 665 ifw$(1)=""then610
  116. 670 next:gosub145:w$(0)=str$(a):m=a*5+1000:print"[147]"
  117. 675 printm;"data"a","w$(1)","w$(2)","w$(3)","e$
  118. 680 print"goto610":goto640
  119. 685 print"[147]remove file number":input"   ";r$:ifval(r$)=0then685
  120. 690 print"[147]":m=val(r$)*5+1000:printm"data"chr$(34)"#"chr$(34)","val(r$)
  121. 695 ifpthenp=0:goto705
  122. 700 print"j$="chr$(34)j$chr$(34)":z=1:goto610":goto640
  123. 705 print"j$="chr$(34)j$chr$(34)":z=1:goto385":goto640
  124. 1000 rem files
  125. 1005 data 1 ,sample coupon,example only,none,none
  126. 50000 dataend
  127.